import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HelperVO, HelperForm, HelperQuery } from '@/api/aiqa/helper/types';

/**
 * 查询智能体管理列表
 * @param query
 * @returns {*}
 */

export const listHelper = (query?: HelperQuery): AxiosPromise<HelperVO[]> => {
  return request({
    url: '/aiqa/helper/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询智能体管理详细
 * @param id
 */
export const getHelper = (id: string | number): AxiosPromise<HelperVO> => {
  return request({
    url: '/aiqa/helper/' + id,
    method: 'get'
  });
};

/**
 * 新增智能体管理
 * @param data
 */
export const addHelper = (data: HelperForm) => {
  return request({
    url: '/aiqa/helper',
    method: 'post',
    data: data
  });
};

/**
 * 修改智能体管理
 * @param data
 */
export const updateHelper = (data: HelperForm) => {
  return request({
    url: '/aiqa/helper',
    method: 'put',
    data: data
  });
};

/**
 * 删除智能体管理
 * @param id
 */
export const delHelper = (id: string | number | Array<string | number>) => {
  return request({
    url: '/aiqa/helper/' + id,
    method: 'delete'
  });
};
